<template>
  <div class="myCell">
    <van-cell is-link>
      <template #title>
        <span class="custom-title">{{ title }}</span>
      </template>
      <template #default>
        <img
          :src="baseUrl + value"
          alt=""
          v-if="type === 'img' && value"
          class="img"
        />
        <img
          class="img"
          v-else-if="type === 'img' && !value"
          src="~@/assets/logo.png"
          alt=""
        />
        <div :value="value" v-else>{{ value }}</div>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  props: ['title', 'value', 'type'],
  data () {
    return {
      baseUrl: process.env.VUE_APP_URL
    }
  }
}
</script>

<style lang="less" scoped>
.myCell {
  .img {
    width: 30px;
    height: 30px;
  }
}
</style>
